#include <stdio.h> 
#include <math.h>

int IsPrime( int num )
{
	int ret = 1;
	for ( int i = 2; i <= (int)sqrt(num); i++ ) {
		if ( num % i == 0 ) {
			ret = 0;
			break;
		}
	}
	return ret;
}

int main()
{
	int n = 0;
	scanf("%d", &n);
	for ( int i = 2; i + 2 <= n; i++ ) {
		if ( IsPrime(i) && IsPrime(i+2) ){
			printf("%d %d\n", i, i+2);
		}
	}
	return 0;
}
